/*
// Copyright (C) 2022, 2024 Artifex Software, Inc.
//
// This file is part of MuPDF.
//
// MuPDF is free software: you can redistribute it and/or modify it under the
// terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option)
// any later version.
//
// MuPDF is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
// details.
//
// You should have received a copy of the GNU Affero General Public License
// along with MuPDF. If not, see <https://www.gnu.org/licenses/agpl-3.0.en.html>
//
// Alternative licensing terms are available from the licensor.
// For commercial licensing, see <https://www.artifex.com/> or contact
// Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
// CA 94129, USA, for further information.
*/

* {
	box-sizing: border-box;
}

/* APPEARANCE */

html {
	font-family: sans-serif;
	font-size: 18px;
}

header {
	border-bottom: 1px solid black;
	background-color: gainsboro;
}

footer {
	border-top: 1px solid black;
	background-color: gainsboro;
}

aside {
	background-color: white;
	border-right: 1px solid black;
}

#message {
	text-align: center;
	font-size: 24pt;
	font-weight: bold;
	color: silver;
}


details {
	width: auto;
}

details[open] > summary {
	background-color: #0004;
}

.artifexLinks {
	position: fixed;
	top:0;
	right:0;
	padding:5px;
}

.artifexLinks a {
	color: black;
	text-decoration: underline;
	margin: 0 5px;
}

.artifexLinks a:hover {
	color: orange;
	text-decoration: none;
}


menu {
	min-width: 140px;
	border: 1px solid black;
	background-color: white;
	color: black;
}

menu li:hover {
	background-color: black;
	color: white;
}

/* LAYOUT */

html {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
}

body {
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	grid-template-rows: auto minmax(0, 1fr) auto;
	width: 100%;
	height: 100%;
	overflow: clip;
}

header {
	position: relative;
	user-select: none;
	grid-column: 1/3;
	grid-row: 1;
	display: flex;
	flex-wrap: wrap;

}

footer {
	grid-column: 1/3;
	grid-row: 3;
	display: flex;
	padding: 8px;
	gap: 8px;
}

aside {
	grid-column: 1;
	grid-row: 2;
	overflow-y: auto;
	width: 250px;
}

main {
	grid-column: 2;
	grid-row: 2;
	overflow: scroll;
}

summary {
	padding: 4px 8px;
	cursor: pointer;
	list-style: none;
}

/* workaround for bug in Safari details appearance */
summary::-webkit-details-marker {
	display: none;
}

menu {
	position: absolute;
	overflow-y: auto;
	margin: 0;
	padding: 0;
	list-style: none;
	z-index: 500;
}

menu li {
	padding: 4px 8px;
	cursor: pointer;
}

/* OUTLINE */
#menubar-panel, #outline-panel {
    background-color: #fff;
    color: #000;
}

#outline-panel ul li a {
	color: #000;
}

#outline {
	font-size: 12px;
}

#outline ul {
	margin: 0;
	padding-left: 20px;
}

#outline a {
	text-decoration: none;
}

#outline a:hover {
	text-decoration: underline;
}

/* PAGES */

#pages {
	margin: 0 auto;
}

div.page {
	position: relative;
	background-color: white;
	margin: 16px auto;
	margin-top: 0;
	/* box-shadow: 0px 2px 8px #0004; */
}

div.page * {
	position: absolute;
}

div.page canvas {
	user-select: none;
}

div.text span {
	white-space: pre;
	line-height: 1;
	color: transparent;
}

div.text ::selection {
	background: hsla(220, 100%, 50%, 0.2);
}

div.link a:hover {
	border: 1px dotted blue;
}

div.search > div {
	pointer-events: none;
	border: 1px solid hotpink;
	background-color: lightpink;
	mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {

    #menubar-panel, #outline-panel {
        background-color: #222;
        color: #fff;
    }

    #outline-panel ul li a {
    	color: #fff;
    }

    #menubar-panel menu {
        background-color: #222;
        color: #fff;
    }

    div.dialog {
        background-color:#222;
        color: #fff;
    }

    .artifexLinks a {
		color: white;

	}
}

@media all and (max-width : 600px)  {

	.artifexLinks {
		display: none;
	}

}

